package com.zy.dp.chainofresponsibility.example4;

public class DepManager2 extends DepManager
{
	public Object handleRequest(RequestModel request)
	{
		if (PreFeeRequestModel.FEE_TYPE.equals(request.getType()))
		{

			return myHandler(request);
		}
		else
		{

			return super.handleRequest(request);
		}
	}

	private Object myHandler(RequestModel request)
	{

		PreFeeRequestModel fr = (PreFeeRequestModel) request;

		if (fr.getFee() < 20000)
		{

			System.out.println("部门经理同意" + fr.getUser() + "预支差旅费用" + fr.getFee()
					+ "元的请求");
			return true;
		}
		else
		{

			if (this.successor != null)
			{
				return this.successor.handleRequest(request);
			}
		}
		return false;
	}
}
